

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh-CN" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh-CN" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>CPT例子 &mdash; WeIdentity  文档</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/theme_overrides.css" type="text/css" />
  <link rel="stylesheet" href="../_static/index.css" type="text/css" />
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" /> 

  
  <script src="../_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="../index.html" class="icon icon-home"> WeIdentity
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../README.html">什么是 WeIdentity？</a></li>
<li class="toctree-l1"><a class="reference internal" href="one-stop-experience.html">WeIdentity 一站式体验</a></li>
<li class="toctree-l1"><a class="reference internal" href="terminologies.html">术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="use-cases.html">使用场景</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-spec.html">WeIdentity 规范</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-installation.html">WeIdentity Java SDK 安装部署</a></li>
<li class="toctree-l1"><a class="reference external" href="https://weidentity.readthedocs.io/projects/javasdk/zh_CN/latest/">WeIdentity Java SDK 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-sample.html">WeIdentity Sample 开发样例</a></li>
<li class="toctree-l1"><a class="reference internal" href="miscellaneous.html">杂项</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-rest.html">WeIdentity RestService</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-endpoint.html">WeIdentity Endpoint Service</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-contract-design.html">WeIdentity 智能合约设计与实现</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">WeIdentity</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> &raquo;</li>
        
      <li>CPT例子</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/docs/cpt-templates.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="cpt">
<span id="cpt-templates"></span><h1>CPT例子<a class="headerlink" href="#cpt" title="永久链接至标题">¶</a></h1>
<div class="section" id="cpt101">
<h2>单次文件转移凭证（CPT101）<a class="headerlink" href="#cpt101" title="永久链接至标题">¶</a></h2>
<p>适用场景：用户授权后，用户的数据由一个机构给到另外一个机构。credential的ID用于标识本次文件转移。这一类Claim一般用户是issuer。</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>角色</p></th>
<th class="head"><p>说明</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>数据提供者</p></td>
<td><p>数据提供者对用户的链外数据、链外资产或服务进行认证登记并负责其真实性。</p></td>
</tr>
<tr class="row-odd"><td><p>数据使用者</p></td>
<td><p>引导获取用户授权，通过授权代理获取到用户授权后，获取到用户的数据资产。</p></td>
</tr>
<tr class="row-even"><td><p>用户授权代理</p></td>
<td><p>1.完成对用户的KYC 2.用户授权信息的上链。例如微众银行WeIdentity小程序就是用户授权代理的角色。</p></td>
</tr>
<tr class="row-odd"><td><p>用户</p></td>
<td><p>用户无法直接接入区块链，而是通过以上三方任意一方接入。用户的认证等级见图。</p></td>
</tr>
</tbody>
</table>
<table class="docutils align-default">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Properties</p></th>
<th class="head"><p>说明</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>&#64;context</p></td>
<td><p>用于描述CPT等信息</p></td>
</tr>
<tr class="row-odd"><td><p>version</p></td>
<td><p>该CPT的版本，endpoint至少需要保证向后兼容性</p></td>
</tr>
<tr class="row-even"><td><p>fileType</p></td>
<td><p>文件类型的标识符，用于机构间互通，可以是CPT类型</p></td>
</tr>
<tr class="row-odd"><td><p>fileId</p></td>
<td><p>文件的标识符，用于机构间互通，可以是某Credential的WeIdentity</p></td>
</tr>
<tr class="row-even"><td><p>hash</p></td>
<td><p>文件的hash</p></td>
</tr>
<tr class="row-odd"><td><p>receiver</p></td>
<td><p>文件的使用者的WeIdentity</p></td>
</tr>
<tr class="row-even"><td><p>signatureValue</p></td>
<td><p>文件的hash</p></td>
</tr>
<tr class="row-odd"><td><p>validDate</p></td>
<td><p>有效期起始日期</p></td>
</tr>
<tr class="row-even"><td><p>expireDate</p></td>
<td><p>凭证过期日期</p></td>
</tr>
<tr class="row-odd"><td><p>signature</p></td>
<td><p>文件所有者的签名列表，是一个数组</p></td>
</tr>
<tr class="row-even"><td><p>signature.type</p></td>
<td><p>签名类型</p></td>
</tr>
<tr class="row-odd"><td><p>signature.created</p></td>
<td><p>签名的创建时间</p></td>
</tr>
<tr class="row-even"><td><p>signature.creator</p></td>
<td><p>签名人的WeIdentity</p></td>
</tr>
<tr class="row-odd"><td><p>signature.nonce</p></td>
<td><p>随机数</p></td>
</tr>
<tr class="row-even"><td><p>signature.signatureValue</p></td>
<td><p>签名的具体value，对整个Credential结构中除去signature字段的其他字段做签名</p></td>
</tr>
</tbody>
</table>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;Claim&quot;</span><span class="o">:</span> <span class="p">{</span>
  <span class="s2">&quot;@context&quot;</span><span class="o">:</span> <span class="s2">&quot;https://weidentity.webank.com/cpt101/v1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;version&quot;</span><span class="o">:</span> <span class="s2">&quot;v1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  <span class="s2">&quot;hash&quot;</span><span class="o">:</span> <span class="s2">&quot;sdfwefwefwfawef2fasdvs3241e132112e1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;validDate&quot;</span><span class="o">:</span> <span class="s2">&quot;2016-06-20T21:19:10Z&quot;</span><span class="p">,</span>
  <span class="s2">&quot;expireDate&quot;</span><span class="o">:</span> <span class="s2">&quot;2026-06-20T21:19:10Z&quot;</span><span class="p">,</span>
  <span class="s2">&quot;signature&quot;</span><span class="o">:</span> <span class="p">[{</span>
    <span class="s2">&quot;type&quot;</span><span class="o">:</span> <span class="s2">&quot;LinkedDataSignature2015&quot;</span><span class="p">,</span>
    <span class="s2">&quot;created&quot;</span><span class="o">:</span> <span class="s2">&quot;2016-06-18T21:19:10Z&quot;</span><span class="p">,</span>
    <span class="s2">&quot;creator&quot;</span><span class="o">:</span> <span class="s2">&quot;did:weid:2323e3e3dweweewew2&quot;</span><span class="p">,</span>
    <span class="s2">&quot;domain&quot;</span><span class="o">:</span> <span class="s2">&quot;www.diriving_card.com&quot;</span><span class="p">,</span>
    <span class="s2">&quot;nonce&quot;</span><span class="o">:</span> <span class="s2">&quot;598c63d6&quot;</span><span class="p">,</span>
    <span class="s2">&quot;signatureValue&quot;</span><span class="o">:</span> <span class="s2">&quot;BavEll0/I1zpYw8XNi1bgVg/sCneO4Jugez8RwDg/+MCRVpjOboDoe4SxxKjkC</span>
<span class="s2">  OvKiCHGDvc4krqi6Z1n0UfqzxGfmatCuFibcC1wpsPRdW+gGsutPTLzvueMWmFhwYmfIFpbBu95t501+r</span>
<span class="s2">    SLHIEuujM/+PXr9Cky6Ed+W3JT24=&quot;</span>
  <span class="p">}]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id1">
<h2>中国内地驾照（CPT***）<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
<table class="docutils align-default">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Properties</p></th>
<th class="head"><p>说明</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>&#64;context</p></td>
<td><p>用于描述CPT等信息</p></td>
</tr>
<tr class="row-odd"><td><p>version</p></td>
<td><p>该CPT的版本，endpoint至少需要保证向后兼容性</p></td>
</tr>
<tr class="row-even"><td><p>id</p></td>
<td><p>驾照的ID</p></td>
</tr>
<tr class="row-odd"><td><p>name</p></td>
<td><p>驾照持有者姓名</p></td>
</tr>
<tr class="row-even"><td><p>sex</p></td>
<td><p>性别</p></td>
</tr>
<tr class="row-odd"><td><p>nationality</p></td>
<td><p>国籍</p></td>
</tr>
<tr class="row-even"><td><p>address</p></td>
<td><p>地址</p></td>
</tr>
<tr class="row-odd"><td><p>class</p></td>
<td><p>准驾车型</p></td>
</tr>
<tr class="row-even"><td><p>issueDate</p></td>
<td><p>初次领证日期</p></td>
</tr>
<tr class="row-odd"><td><p>validDate</p></td>
<td><p>有效期起始日期</p></td>
</tr>
<tr class="row-even"><td><p>expireDate</p></td>
<td><p>过期日期</p></td>
</tr>
</tbody>
</table>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;Claim&quot;</span><span class="o">:</span> <span class="p">{</span>
  <span class="s2">&quot;@context&quot;</span> <span class="o">:</span> <span class="s2">&quot;https://weidentity.webank.com/cpt100/v1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;version&quot;</span> <span class="o">:</span> <span class="s2">&quot;v1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;id&quot;</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  <span class="s2">&quot;weid&quot;</span> <span class="o">:</span> <span class="s2">&quot;did:weid:1:0xdfsdf....&quot;</span>
  <span class="s2">&quot;name&quot;</span> <span class="o">:</span> <span class="s2">&quot;张小明&quot;</span><span class="p">,</span>
  <span class="s2">&quot;sex&quot;</span> <span class="o">:</span> <span class="s2">&quot;男&quot;</span><span class="p">,</span>
  <span class="s2">&quot;nationality&quot;</span> <span class="o">:</span> <span class="s2">&quot;中国&quot;</span><span class="p">,</span>
  <span class="s2">&quot;address&quot;</span> <span class="o">:</span> <span class="s2">&quot;重庆&quot;</span><span class="p">,</span>
  <span class="s2">&quot;class&quot;</span> <span class="o">:</span> <span class="s2">&quot;C1&quot;</span><span class="p">,</span>
  <span class="s2">&quot;issueDate&quot;</span> <span class="o">:</span> <span class="s2">&quot;2010-06-20T21:19:10Z&quot;</span><span class="p">,</span>
  <span class="s2">&quot;validDate&quot;</span> <span class="o">:</span> <span class="s2">&quot;2016-06-20T21:19:10Z&quot;</span><span class="p">,</span>
  <span class="s2">&quot;expireDate&quot;</span> <span class="o">:</span> <span class="s2">&quot;2026-06-20T21:19:10Z&quot;</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h2>香港地区驾照（CPT***）<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
<p>数据结构待定</p>
</div>
<div class="section" id="padi-cpt">
<h2>PADI潜水执照（CPT***）<a class="headerlink" href="#padi-cpt" title="永久链接至标题">¶</a></h2>
<p>数据结构待定</p>
</div>
</div>


           </div>
           
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright (2018) WeBank Co., Ltd.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
        <script src="../_static/translations.js"></script>
    

  

  <script type="text/javascript" src="../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>